package com.ruoyi.crm.crawling.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.ruoyi.crm.crawling.service.ICrmCrawlingService;
import com.ruoyi.crm.crawling.util.DemoAutoNewsCrawler;

@Component("crawlingTask")
public class CrawlingTask {
	
	@Autowired
    private ICrmCrawlingService crmCrawlingService;

    /**
     * 定期爬取数据
     * @throws Exception 
     */
    public void crawlingRun() throws Exception{
    	
    	DemoAutoNewsCrawler crawler = new DemoAutoNewsCrawler("crawl", true, crmCrawlingService);
    	crawler.start(150);
    	  
    }
}
